// 登录接口需要携带的参数ts类型
export interface LoginForm {
  parent_username: string,
  child_username: string,
  password: string,
  is_primary:string
}


interface dataType {
 token?: string,
 message?: string
}

// 登录接口返回的数据ts类型
export interface LoginResponseData {
  code: Number,
  data: dataType
}




// 定义用户信息接口返回的数据 ts类型


interface userInfoType {
  dbName: string;
  parent_username: string;
  user_info: Userinfo;
  username: string;
  user_id: number;
  token: string;
  role_id: number;
  role_name: string;
  permissions: string[];
}


interface Userinfo {
  id: number;
  username: string;
  company_name: string;
  token: string;
  last_login_time: string;
  last_login_ip: string;
  expire_time: string;
  phone: string;
  parent_username: string;
  is_primary: number;
  role_name: string;
  job_type: any[];
  is_foreman: number;
  foreman_job_type_ids: null;
}


export interface UserInfoResponseData {
  code: number,
  data: userInfoType,
}



//定义路由接口返回的数据类型
interface RootObject {
  id: number;
  name: string;
  route: string;
  description: string;
  created_at: string;
  updated_at: string;
  pid: number;
  icon: string;
  is_menu: number;
  path: string;
  sort: number;
  is_del: number;
  component: string;
  redirect: string;
  value: number;
  children: Child[];
}

interface Child {
  id: number;
  name: string;
  route: string;
  description: string;
  created_at: string;
  updated_at: string;
  pid: number;
  icon: string;
  is_menu: number;
  path: string;
  sort: number;
  is_del: number;
  component: string;
  redirect: string;
  value: number;
}


export interface UserMenuResponseData {
  code: number,
  data: RootObject
}

